<?php

/**
 * This is the model class for table "sekolahmuridgurusmu".
 *
 * The followings are the available columns in table 'sekolahmuridgurusmu':
 * @property integer $smgsmu_id
 * @property integer $smgsmu_kec
 * @property integer $smgsmu_jmlsekolah
 * @property integer $smgsmu_jmlmurid
 * @property integer $smgsmu_jmlguru
 * @property integer $smgsmu_tahun
 *
 * The followings are the available model relations:
 * @property Kecamatan $smgsmuKec
 */
class Sekolahmuridgurusmu extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Sekolahmuridgurusmu the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'sekolahmuridgurusmu';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('smgsmu_kec, smgsmu_jmlsekolah, smgsmu_jmlmurid, smgsmu_jmlguru, smgsmu_tahun', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('smgsmu_id, smgsmu_kec, smgsmu_jmlsekolah, smgsmu_jmlmurid, smgsmu_jmlguru, smgsmu_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'smgsmuKec' => array(self::BELONGS_TO, 'Kecamatan', 'smgsmu_kec'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'smgsmu_id' => 'Smgsmu',
			'smgsmu_kec' => 'Smgsmu Kec',
			'smgsmu_jmlsekolah' => 'Smgsmu Jmlsekolah',
			'smgsmu_jmlmurid' => 'Smgsmu Jmlmurid',
			'smgsmu_jmlguru' => 'Smgsmu Jmlguru',
			'smgsmu_tahun' => 'Smgsmu Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('smgsmu_id',$this->smgsmu_id);
		$criteria->compare('smgsmu_kec',$this->smgsmu_kec);
		$criteria->compare('smgsmu_jmlsekolah',$this->smgsmu_jmlsekolah);
		$criteria->compare('smgsmu_jmlmurid',$this->smgsmu_jmlmurid);
		$criteria->compare('smgsmu_jmlguru',$this->smgsmu_jmlguru);
		$criteria->compare('smgsmu_tahun',$this->smgsmu_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}